package thread.Test;

public class SleepTest {

	public static void main(String[] args) {
		ThreadC t1=new ThreadC("t1");
		t1.start();

	}

}

class ThreadC extends Thread {
	public ThreadC(String name) {
		super(name);
	}

	public synchronized void run(){
		for (int i = 0; i < 10; i++) {
			System.out.printf("%s [%d]:%d\n", this.getName(),
					this.getPriority(), i);
			if (i%4 == 0){
				try {
					Thread.sleep(1000);//ms 毫秒
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
		}
	}
};